package com.hqyj.fj.javaSpringBoot.modules.common.controller;

import com.hqyj.fj.javaSpringBoot.modules.common.entity.Result;
import com.hqyj.fj.javaSpringBoot.modules.common.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/api")
public class ImageController {
    @Autowired
    private ImageService imageService;

    /*
    * 127.0.0.1:8081/api/image/profile-big
    * */
    @PostMapping(value = "/image/{imageType}",consumes ="multipart/form-data" )
    public Result<String> uploadImag(@RequestParam MultipartFile file,
                                     @PathVariable String imageType){
        return imageService.uploadImag(file, imageType);


    }
}
